﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using DevTrends.MvcDonutCaching;
using KMF.Common;
using KMF.DAL;
using KMF.Utility;
using KMF.WebUI.CustomHelpers;
using KMF.WebUI.Infrastructure;
using System.Security.Cryptography;

namespace KMF.WebUI.Controllers
{
    public class NewsController : Controller
    {
        //
        // GET: /News/

        public ActionResult Index(int cateId,string newsId ="")
        {
            ViewBag.CateName = NewsCategoryDb.GetById(cateId).CateName.ToString();
            var model = NewsDb.GetById(newsId);
            return View(model);
        }
        public ActionResult About(int cateId)
        {
            ViewBag.CateName = NewsCategoryDb.GetById(cateId).CateName.ToString();
            var model = NewsCategoryDb.GetAllNewsCategoryByType(cateId).GetRange(0,1) ?? new List<NewsDto>();
            return View(model);
        }

        public ActionResult Contact(int cateId)
        {
            ViewBag.CateName = NewsCategoryDb.GetById(cateId).CateName.ToString();
            var model = NewsCategoryDb.GetAllNewsCategoryByType(cateId).GetRange(0, 1) ?? new List<NewsDto>();
            return View(model);
        }
    }
}
